package com.zt.bigdata.elasticsearch.utils.transport.apis;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.zt.bigdata.elasticsearch.utils.transport.ESClient;
import org.elasticsearch.client.transport.TransportClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @ClassName AggApi
 * @Description
 * @Author zhangtonghy
 * @Date 2019-02-22 08:46
 * @Copyright: 版权所有 (C) zt zt.
 * @注意：本内容仅限于zt内部传阅，禁止外泄以及用于其他的商业目的
 **/
public class AggApi {
    private TransportClient transportClient;
    private ObjectMapper mapper = new ObjectMapper();
    private static final Logger logger = LoggerFactory.getLogger(SearchApi.class);

    private TransportClient getClient() {
        if (null == transportClient) {
            ESClient esClient = new ESClient("my-application", "localhost:9300");
            transportClient = esClient.getClient();
        }
        return transportClient;
    }
}
